<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>${systemName}</title>
    <meta name="description" content="${system.description}"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="renderer" content="webkit"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>

    <link href="${basePath}/style/def/favicon.ico" rel="shortcut icon"/>
    <link href="${basePath}/style/def/css/bootstrap.css" type="text/css" rel="stylesheet"/>
    <link href="${basePath}/style/def/css/reset.css" type="text/css" rel="stylesheet"/>
    <link href="${basePath}/style/def/css/login.css" type="text/css" rel="stylesheet"/>

    <script type="text/javascript" src="${basePath}/style/def/js/jquery-1.9.1.js"></script>
    <script type="text/javascript" src="${basePath}/style/def/js/jquery.validate.js"></script>
    <script type="text/javascript" src="${basePath}/style/def/js/jquery.metadata.js"></script>
    <script type="text/javascript" src="${basePath}/style/def/i18n/messages/messages_cn.js"></script>
    <script type="text/javascript" src="${basePath}/style/def/js/jquery.form.js"></script>
    <script type="text/javascript" src="${basePath}/style/def/js/artDialog.js"></script>
    <script type="text/javascript" src="${basePath}/style/def/js/console.bigdata.js"></script>
</head>

<body>
<div class="container loginWrapper">
    <div class="loginCon" style="border:1px solid #cdcdcd;">
        <form id="loginForm" action="${basePath}/login.html" class="loginFormWrapper" method="post">
            <span class="lfFonts">用户名：</span>
            <input type="text" name="username" id="username" class="lfInputs lgUsername required">
            <span class="lfFonts">密码：</span>
            <input type="password" name="password" id="password" class="lfInputs lgUerPsw required">

            <#if error??><span class="lfFonts" style="color:red;">${error.text!''}</span></#if>
            <input type="button" onclick="submitForm()" class="lgsubmitbtn" value="">

        </form>
    </div>
</div>
</body>
<script type="text/javascript">
    if (document.getElementById('username').value == "") {
        document.getElementById('username').focus();
    } else {
        document.getElementById('password').focus();
    }

    function submitForm() {
        if ($("#loginForm").valid()) {
            $("#loginForm").ajaxSubmit({
                url: "${basePath}/checkpassword.html",
                success: function (data) {
                    if (data == "yes") {
                        var reg = /^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,255}$|^(?=.*\d)(?=.*[a-z])(?=.*[-.!@#$%^&*()+?><]).{8,255}$|^(?=.*\d)(?=.*[A-Z])(?=.*[-.!@#$%^&*()+?><]).{8,255}$|^(?=.*[a-z])(?=.*[A-Z])(?=.*[-.!@#$%^&*()+?><]).{8,255}$/;
                        var result = $("#password").val().match(reg);
                        if (result != null) {
                            $("#loginForm").submit();
                        } else {
                            tipArtPage("密码修改（提示：密码过于简单。）", "${basePath}/passwordupdate.html?username=" + encodeURIComponent($("#username").val()), 550);
                        }
                    } else if (data == "no") {
                        tipArtPage("密码修改（提示：密码已过期。）", "${basePath}/passwordupdate.html?username=" + encodeURIComponent($("#username").val()), 550);
                    } else {
                        alertMsg("用户名或密码输入错误，请重新输入。");
                    }
                }
            });
        }

    }

    function alertMsg(msg) {
        var d;
        if (msg.length > 40) {
            d = art.dialog({
                id: "dialog",
                content: msg,
                width: 500
            });
        } else {
            d = art.dialog({
                id: "dialog",
                time: 2000,
                content: msg
            });
        }
    }

        $(document).ready(function(){
            $("input[type='checkbox']").css("border","solid 0px #fff");
            $("input[type='radio']").css("border","solid 0px #fff");
            <#if ation_message??>
                alertMsg('${ation_message}');
            </#if>
        });
</script>
</html>